<?php


namespace app\common\model;


class UserOrderBrokerageModel extends CommonModel
{
    protected $name = 'user_order_brokerage';

    public function orderInfo(): \think\model\relation\hasOne
    {
        return $this->hasOne(OrderModel::class, 'nb', 'order_nb');
    }

    public function getUserOrderBrokerageList($where = [])
    {
        return $this->with(
            [
                'orderInfo',
            ]
        )->order(
            [
                'create_time' => 'desc',
            ]
        )->where($where)->append([])->select();
    }

    public function getUserOrderBrokerageListPaginate($where = [], $page = 1, $limit = 10)
    {
        return $this->with([])->order(
            [
                'create_time' => 'desc',
            ]
        )->where($where)->append([])->paginate(
            [
                'page'      => $page,
                'list_rows' => $limit,
            ]
        );
    }

    public function getUserOrderBrokerage()
    {

    }

    public function getUserOrderBrokerageRanking()
    {

    }
}